class AccountingBaseElement {
        static hasMany = [generalLedgerAccounts:GeneralLedgerAccount]

        Integer firstGrade
        Integer secondGrade
        Integer thirdGrade
        String elementName
        Boolean isDefaultDebit
        String explanantionOfElement

        static constraints = {
          firstGrade(blank:false, max:9)
          secondGrade(blank:false, max:99)
          thirdGrade(blank:false, unique:true, max:999)
          elementName(blank:false)
          isDefaultDebit(blank:false)
          explanantionOfElement(maxSize:10000)
        }

        @Override
        String toString() { 
	  return "$thirdGrade:$elementName"
	 }

	static mapping = {
	  sort "thirdGrade"
	}
}
